package uk.ac.bath.machines.bool;

import uk.ac.bath.legacy.Operator;
import uk.ac.bath.legacy.Value;
import uk.ac.bath.legacy.VectorState;

abstract class BinaryOperator extends Operator {

    private void tick(VectorState in,VectorState out) {
        binaryOp(in.at(1),in.at(2),out.at(0));
    }

    public void tick(VectorState in,VectorState out,int map[]) {
        binaryOp(in.v[map[1]],in.v[map[2]],out.v[map[0]]);
    }


    public int getStateSize() {
        return 3;
    }

    abstract public void binaryOp(Value a,Value b,Value result);
    abstract public Object clone();
}
